<%@page import="br.com.guardaroupavirtual.model.LookEvento"%>
<%@page import="br.com.guardaroupavirtual.model.Categoria"%>
<%@page import="br.com.guardaroupavirtual.helper.DataHelper"%>
<%@page import="org.hibernate.id.uuid.Helper"%>
<%@page import="br.com.guardaroupavirtual.model.Usuario"%>
<%@page import="java.util.List"%>
<jsp:include page="../compartilhado/header.jsp"></jsp:include>

<%
	List<LookEvento> lookEventos = (List<LookEvento>) request.getAttribute("lookEventos");
%>
<h2>Looks cadastrados</h2>
<a href="LookEvento?cmd=cadastrar">Novo</a>
<table class="table table-striped">
	<thead>
	  <tr>
	    <th>Nome</th>
	    <th>Loja</th>
	    <th></th>
	  </tr>
	</thead>
	<tbody>
	<% for(LookEvento look : lookEventos){ %>
		 <tr>
		   <td><%=look.getNome() %></td>
		   <td><%=look.getLoja().getNome() %></td>
		   <td>
		   	<div class="btn-group pull-right">
			   	<%
			   	  Usuario usuarioSessao = (Usuario) request.getSession().getAttribute("usuario");
			   	  if(look.getUsuario().getId() == usuarioSessao.getId()){ %>		   	
			   		<a href="LookEvento?cmd=alterar&id=<%=look.getId()%>">Alterar</a>
			   		<a href="LookEvento?cmd=deletar&id=<%=look.getId()%>">Excluir</a>
			   	<%} %>
		   	</div>
		   </td>		   
		 </tr>
	<% } %>	 
	</tbody>	 
</table>


<jsp:include page="../compartilhado/footer.jsp"></jsp:include>